#include <iostream>
#include <string>

using namespace std;

class House
{
public:
	void setDoor(string door)
	{
		m_door = door;
	}
	void setWindows(string windows)
	{
		m_windows = windows;
	}
	void setWall(string wall)
	{
		m_wall = wall;
	}

	//-------------------
	string GetDoor()
	{
		cout << m_door << endl;
		return m_door;
	}
	string GetWindow()
	{
		cout << m_windows << endl;
		return m_windows;
	}
	string GetWall()  
	{ 
		cout << m_wall << endl;
		return m_wall; 
	}
private:
	string m_door;
	string m_windows;
	string m_wall;
};

class  Build
{
public:
	virtual void buildWall() = 0;
	virtual void buildWindow() =0;
	virtual void buildDoor() = 0;
	virtual	House *getHouse() = 0;
	//virtual void Construct() = 0;

};

// 建造别墅的工程队
class BuildVilla :public Build
{
public:
	BuildVilla()
	{
		house = new House;
	}
    

	
	House *getHouse()
	{
		return house;
	}
public:
	void buildWall()
	{
		house->setWall("别墅的墙");
	}
	void buildWindow()
	{
		house->setWindows("别墅的窗户");
	}
	void buildDoor()
	{
		house->setDoor("别墅的门");
	}
private:
	House *house;
};

// 建造普通房的工程队
class BuildCommonHouse : public Build
{
public:
	BuildCommonHouse()
	{
		house = new House;
	}

	House *getHouse()
	{
		return house;
	}
	
	void Construct()
	{
		buildWall();
		buildWindow();
		buildDoor();
	}
public:
	void buildWall()
	{
		house->setWall("普通房的墙");
	}
	void buildWindow()
	{
		house->setWindows("普通房的窗户");
	}
	void buildDoor()
	{
		house->setDoor("普通房的门");
	}
private:
	House *house;
};




int main1()
{
	Build *build = new BuildVilla;
	build->Construct();
	House *house = build->getHouse();
}



